﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class shouye : System.Web.UI.Page
{
    int messageID = -1;
    protected void Page_Load(object sender, EventArgs e)
    {   ///获取客户端的IP地址
        TextBox2.Text = Request.UserHostAddress;
        if (Request.Params["MessageID"] != null)
        {
            messageID = Int32.Parse(Request.Params["MessageID"].ToString());
        }
    }
    protected void btnClear_Click(object sender, EventArgs e)
    {
        tbMessage.Text = string.Empty;
    }
    protected void btnCommit_Click(object sender, EventArgs e)
    {
        Class1 message = new Class1();
        ///发表回复
        if (message.AddReply(tbMessage.Text, Request.UserHostAddress, messageID) > 0)
        {	///重定向到留言页面		
            Response.Redirect("Index.aspx");
        }
    }
}